/**
 * 
 */
package slhs.tempo.scriptGenerator;

import java.awt.LayoutManager;
import java.awt.event.ActionEvent;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import org.mlc.swing.layout.LayoutConstraintsManager;

import slhs.tempo.TableAnalyzer.IntegerField;

/**
 * CrossModalHemiProbeDataPanelHandler.java
 * 
 * @author Swapnil Devikar
 * 
 */
public class CrossModalHemiProbeDataPanelHandler extends JPanel implements PanelHandler {

    private static final String CROSS_MODAL_HEMI_PROBE_DATA_PANEL_LAYOUT = "CROSS_MODAL_HEMI_PROBE_DATA_PANEL_LAYOUT.xml";
    private JPanel crossModalHemiProbeDataPanel;
    // here are declarations for the controls you created
    private JLabel expectedAnswerLabel;
    private JComboBox categoriesComboBox;
    private JComboBox expectedAnswercomboBox;
    private JLabel probeLabel;
    private JTextField filePathTextField;
    private JTextField probeTextField;
    private JTextField pauseBeforeProbeTextField;
    private JLabel pauseBeforeProbeLabel;
    private JLabel filePathLabel;
    private JLabel categoriesLabel;
    private JButton browseButton;

    public CrossModalHemiProbeDataPanelHandler() {
	initComponents();
	addComponents();
    }

    /**
     * 
     */
    private void initComponents() {

	crossModalHemiProbeDataPanel = new JPanel();
	// here are declarations for the controls you created
	expectedAnswerLabel = new JLabel("Expected Answer");
	categoriesComboBox = new JComboBox(UtilityConstants.CATEGORIES);
	expectedAnswercomboBox = new JComboBox(UtilityConstants.EXPECTED_ANSWERS);
	probeLabel = new JLabel("Probe");
	filePathTextField = new JTextField();
	probeTextField = new JTextField();
	pauseBeforeProbeTextField = new IntegerField();
	pauseBeforeProbeLabel = new JLabel("Pause Before Probe (msec.)");
	filePathLabel = new JLabel("File Path");
	categoriesLabel = new JLabel("Categories");
	browseButton = new JButton("Browse");

	// configure components
	categoriesComboBox.setEditable(true);

    }

    /**
     * 
     */
    private void addComponents() {

	LayoutConstraintsManager layoutConstraintsManager = LayoutConstraintsManager.getLayoutConstraintsManager(this
		.getClass().getResourceAsStream(CROSS_MODAL_HEMI_PROBE_DATA_PANEL_LAYOUT));
	LayoutManager panelLayout = layoutConstraintsManager.createLayout("panel", this);
	crossModalHemiProbeDataPanel.setLayout(panelLayout);
	// here we add the controls to the container.
	crossModalHemiProbeDataPanel.add(expectedAnswerLabel, "expectedAnswerLabel");
	crossModalHemiProbeDataPanel.add(categoriesComboBox, "categoriesComboBox");
	crossModalHemiProbeDataPanel.add(expectedAnswercomboBox, "expectedAnswercomboBox");
	crossModalHemiProbeDataPanel.add(probeLabel, "probeLabel");
	crossModalHemiProbeDataPanel.add(filePathTextField, "filePathTextField");
	crossModalHemiProbeDataPanel.add(probeTextField, "probeTextField");
	crossModalHemiProbeDataPanel.add(pauseBeforeProbeTextField, "pauseBeforeProbeTextField");
	crossModalHemiProbeDataPanel.add(pauseBeforeProbeLabel, "pauseBeforeProbeLabel");
	crossModalHemiProbeDataPanel.add(filePathLabel, "filePathLabel");
	crossModalHemiProbeDataPanel.add(categoriesLabel, "categoriesLabel");
	crossModalHemiProbeDataPanel.add(browseButton, "browseButton");

    }

    /*
     * (non-Javadoc)
     * 
     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
     */
    @Override
    public void actionPerformed(ActionEvent e) {
	// TODO Auto-generated method stub

    }

    /*
     * (non-Javadoc)
     * 
     * @see slhs.tempo.scriptGenerator.PanelHandler#getPanel()
     */
    @Override
    public JPanel getPanel() {
	return crossModalHemiProbeDataPanel;
    }

}
